package com.poidemo;

import lombok.Data;
import lombok.ToString;

import java.util.List;

/**
 * @author zhuhaibo
 * @version 1.0
 * @date 2021/3/13 20:58
 */

@Data
@ToString
public class ExcelModel {
    /**
     * excel 文件路径
     */
    private String excelFilePath;
    /**
     * 分割后的文件目录
     */
    private String excelChildFileDir;
    /**
     * excel 名称
     */
    private String excelName;
    /**
     * sheet 名称
     */
    private String sheetName = "Sheet1";
    /**
     * excel 总记录数
     */
    private int totalRows;
    /**
     * 分割文件后每个文件的记录数
     */
    private int fileSize = 20000;
    /**
     * 分割后的文件数
     */
    private int fileCount;
    /**
     * 分割后的文件集合
     */
    private List<FileInfoModel> files;
    /**
     * 计算总行数时是否去表头
     */
    private boolean isRemoveHeader = true;
    /**
     * 是否去除重复数据
     */
    private boolean isClearRepeat = false;
    /**
     * 导入文件过程中是否出错
     */
    private boolean isError;

    public ExcelModel() {
        super();
    }

    public ExcelModel(String sheetName, int totalRows, int fileSize, int fileCount, boolean isRemoveHeader, boolean isClearRepeat) {
        this.sheetName = sheetName;
        this.totalRows = totalRows;
        this.fileSize = fileSize;
        this.fileCount = fileCount;
        this.isRemoveHeader = isRemoveHeader;
        this.isClearRepeat = isClearRepeat;
    }

    public ExcelModel(String sheetName, int totalRows, int fileCount, boolean isRemoveHeader, boolean isClearRepeat) {
        this.sheetName = sheetName;
        this.totalRows = totalRows;
        this.fileCount = fileCount;
        this.isRemoveHeader = isRemoveHeader;
        this.isClearRepeat = isClearRepeat;
    }

    public ExcelModel(String sheetName, boolean isRemoveHeader, boolean isClearRepeat) {
        this.sheetName = sheetName;
        this.isRemoveHeader = isRemoveHeader;
        this.isClearRepeat = isClearRepeat;
    }

    public ExcelModel(String sheetName) {
        this.sheetName = sheetName;
    }
}
